package com.cims.action.auth;

import com.cims.action.BaseAction;
import com.cims.bo.customer.CustomerBO;
import com.cims.bo.customer.CustomerBOImpl;

public class LoginAction extends BaseAction{

	/** serialVersionUID */
	private static final long	serialVersionUID	= 1L;

	private String				username;

	private String				password;

	private CustomerBO			bo					= new CustomerBOImpl();

	public String login(){
		try{
			if(bo.authenticateCustomer(username, password)){
				session.put("authed", true);
				session.put("user", bo.getCustomerDetail(username));
				return SUCCESS;
			}else{
				return ERROR;
			}
		}catch(Exception ex){
			return ERROR;
		}
	}

	public String getUsername(){
		return username;
	}

	public void setUsername(String username){
		this.username = username;
	}

	public String getPassword(){
		return password;
	}

	public void setPassword(String password){
		this.password = password;
	}
}
